package com.example.observer.eventbus;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ObserverAction {
    private Method method;
    private Object obj;

    public ObserverAction(Method method, Object obj) {
        this.method = method;
        this.obj = obj;
    }

    public void invoke(Object evenObject) {
        try {
            this.method.invoke(this.obj, evenObject);
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
